#include "WhiteRect.h"
#include "DrawDlg.h"
#include "LineEdit.h" 
#include "myfunction.h"

#if !defined(AFX_DLGRJ_H__4067BFAA_9CE3_4FAC_BC33_9160FF160A35__INCLUDED_)
#define AFX_DLGRJ_H__4067BFAA_9CE3_4FAC_BC33_9160FF160A35__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgRj.h : header file
//
#define MYMESSAGE_RQCHANGE  WM_USER +1
/////////////////////////////////////////////////////////////////////////////
// CDlgRj dialog
class CDrawJZ;
class CDlgRj : public CDialog
{
// Construction
public:
	int RefreshRKTHList(int i);
	int RefreshXSTHList(int i);
	int RefreshRKList(int i);
	int RefreshXSList(int i);
	CString PrepareRKTHSQL();
	CString PrepareRKSQL();
	CString PrepareXSTHSQL();
	CString PrepareXSSQL();
	bool RefreshListView(CString sql);
	bool InitListView();
	bool InitBaseInfo();
	bool InitWhiteFrame();
	CDlgRj(bool isrj,CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CDlgRj)
	enum { IDD = IDD_DIALOG_RJ };
	CListCtrl	m_list;
	CComboBox	m_comboYue;
	CDateTimeCtrl	m_tcRq;
	int		m_iYue;
	//}}AFX_DATA

	int					m_iOldYue;
	CWhiteRect			m_whiteframe;
	CLineEdit			m_edit;
	CString				m_strRq;
	CString				m_strMainSQL;
	CString				m_strWhereSQL;
	bool				m_bRj;
	CString				m_strRqUp;
	CString				m_strRqDown;
	CDrawJZ*			m_draw;
	friend	class CDrawJZ ;
	LRunSql				m_runsql;
// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDlgRj)
	public:
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual BOOL DestroyWindow();
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CDlgRj)
	virtual void OnOK();
	virtual void OnCancel();
	virtual BOOL OnInitDialog();
	afx_msg void OnDatetimechangeDatetimepicker1(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSelendokCombo1();
	afx_msg void OnButtonPrint();
	//}}AFX_MSG
	afx_msg void OnMyRqChange();
	DECLARE_MESSAGE_MAP()
};


class CDrawJZ : public CDrawDlg  
{
public:
	CListCtrl* GetListCtrl();
	CDrawJZ(CDlgRj* dlg);
	virtual ~CDrawJZ();
	virtual void PrintDlg(CDC* pDC, CPrintInfo* pInfo);
	virtual void PrintPageHeader(CDC* pDC, CPrintInfo* pInfo);

	CDlgRj*				parent;
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DLGRJ_H__4067BFAA_9CE3_4FAC_BC33_9160FF160A35__INCLUDED_)
